<%@page import="com.jhs.kjs.model.UserModel"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ko" lang="ko">
<head>
<title>알당</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<%@ include file="/WEB-INF/views/include/common.jsp" %>	
<link rel="stylesheet" type="text/css" href="${cssUrl}/pop/base.css" />
<link rel="stylesheet" type="text/css" href="${cssUrl}/pop/contents.css" />

</head>
<body>
<div class="join_id">
	<h2 id="userId">아이디 찾기</h2>
  <div class="con" id="contents">
  		<dl class="find">
            <dt><img src="${imgUrl}/name.gif" alt="이름" /></dt>
            <dd><input type="text" id="userName" name="userName" style="width:188px;"/></dd>
            <dt class="mgtop10"><img src="${imgUrl}/email.gif" alt="이메일" /></dt>
            <dd class="mgtop10"><input type="text" id="preEmail" name="preEmail" style="width:84px;" onkeypress="return runScript(event)" /> @ <input type="text" style="width:84px;" id="postEmail" name="postEmail" onkeypress="return runScript(event)"/></dd>
        </dl>
        <div class="btn"><a href="javascript:findId();"><img src="${imgUrl}/id_find_btn.gif" alt="아이디찾기" /></a></div>
  </div>
</div>
<script type="text/javascript">
$(function(){
	
});

var findId = function(){
	var userName = $('#userName').val();
	var preEmail = $('#preEmail').val();
	var postEmail = $('#postEmail').val();
	if(postEmail && userName && preEmail){
		var url = "/pass/findUserId.json";
		var param = {
				userName:userName,
				preEmail : preEmail,
				postEmail:postEmail
		};
		AjaxPost(url, param, function(data){
			if(data.result){
				if(data.userId){
					alert(data.result);
				}
			}
		});
	}
};

function runScript(e) {
    if (e.keyCode == 13) {
    	findId();
        return false;
    }
}
</script>
</body>
</html>
